package com.wgts.wgts.mvp.view.activity.bootpage;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;

import com.wgts.wgts.R;
import com.wgts.wgts.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class BootPageActivity extends BaseActivity {


    private List<Fragment> fragments ;


    @BindView(R.id.view_page)
    ViewPager viewPage;

    @Override
    public void init() {
        fragments = new ArrayList<>();
        fragments.add(BootPageFragment.getInstance(R.mipmap.boot_one));
        fragments.add(BootPageFragment.getInstance(R.mipmap.boot_two));
        fragments.add(BootPageFragment.getInstance(R.mipmap.boot_three));
    }

    @Override
    public void onCreate(Bundle saveInstanceBundle) {
        super.onCreate(saveInstanceBundle);
        setContentView(R.layout.boot_page_activity);
        ButterKnife.bind(this);
        initView();
    }


    private void initView(){
        viewPage.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) {
            @Override
            public Fragment getItem(int i) {
                return fragments.get(i);
            }

            @Override
            public int getCount() {
                return fragments.size();
            }
        });
    }


//    @OnClick(R.id.jump)
//    public void onViewClicked() {
//        SharedpreferencesHelper.getInstance().write(AppConstant.SHARED_VERSION, AppInfor.getInstance().getAppVersionCode());
//        Intent intent = new Intent(BootPageActivity.this, MoHuMainActivity.class);
//        startActivity(intent);
//        finish();
//    }
}
